<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="/js/jquery-3.2.1.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<form:form action="add" method="post" modelAttribute="p">
		植物名字:<form:input path="name"/><br>
		植物描述:<form:input path="describes"/><br>
		植物类型:<form:select path="type" id="pp"><br>
				<form:option value="">--请选择--</form:option>
			</form:select><br>
			<form:button>添加</form:button>
	</form:form>
	
</body>
<script type="text/javascript">
	$(function(){
		
		$.post("ttlist",function(obj){
			
				for ( var i in obj) {
					$("#pp").append("<option value='"+obj[i].tid+"'>"+obj[i].tname+"</option>");
				}
			
		})
		
		
		
		
		
		
		
		
		
	})



</script>
</html>